package tripmaker

object Monto {
  val Cero = Monto(0, Moneda.USD)
}

case class Monto(valor: BigDecimal, moneda: Moneda) {

  def inUSD: Monto = in(Moneda.USD)
  def in(m: Moneda): Monto = Monto(valor * moneda.tc(m), m)

  import BigDecimal.RoundingMode.{ HALF_UP => HalfUp }

  override def toString = "$" + valor.setScale(2, HalfUp) + " " + moneda
}